#!/usr/bin/python
# -*- coding: utf-8 -*-

from __future__ import print_function, unicode_literals,\
    absolute_import, division

import sys

def is_last(i, v, edges):
    for j in range(i + 1, len(edges)):
        edge = edges[j]
        if v == edge[0] or v == edge[1]:
            return False
    return True

def get_square_avg(arr):
    s = 0
    for v in arr:
        s += v * v
    return s / len(arr)

def main():
    edges = []
    for line in sys.stdin:
        ar = line.strip().split()
        c1 = int(ar[0])
        c2 = int(ar[1])
        edge = (min(c1, c2), max(c1, c2))
        edges.append(edge)

    frontier_sizes = [0]
    frontier = set()

    for i, e in enumerate(edges):
        frontier.add(e[0])
        frontier.add(e[1])
        if is_last(i, e[0], edges):
            frontier.remove(e[0])
        if is_last(i, e[1], edges):
            frontier.remove(e[1])
        frontier_sizes.append(len(frontier))

    print("max frontier size = {}".format(max(frontier_sizes)))
    print("average frontier size = {}".format(sum(frontier_sizes) / len(frontier_sizes)))
    print("average (frontier size)^2 = {}".format(get_square_avg(frontier_sizes)))
    print("sequence = {}".format(frontier_sizes[0]), sep = "", end = "")
    for f in frontier_sizes[1:]:
        print(", " + str(f), sep = "", end = "")
    print()

if __name__ == '__main__':
    main()
